Optimal. Leaf size=33 \[ -\frac{a A \cos (c+d x)}{d}-\frac{a A \tanh ^{-1}(\cos (c+d x))}{d}-2 a A x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0575666, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {21, 3788, 8, 4045, 3770} \[ -\frac{a A \cos (c+d x)}{d}-\frac{a A \tanh ^{-1}(\cos (c+d x))}{d}-2 a A x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 3788
Rule 8
Rule 4045
Rule 3770
Rubi steps
\begin{align*} \int (a-a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx &=\frac{A \int (a-a \csc (c+d x))^2 \sin (c+d x) \, dx}{a}\\ &=\frac{A \int \left (a^2+a^2 \csc ^2(c+d x)\right ) \sin (c+d x) \, dx}{a}-(2 a A) \int 1 \, dx\\ &=-2 a A x-\frac{a A \cos (c+d x)}{d}+(a A) \int \csc (c+d x) \, dx\\ &=-2 a A x-\frac{a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac{a A \cos (c+d x)}{d}\\ \end{align*}
Mathematica [B] time = 0.0267257, size = 72, normalized size = 2.18 \[ \frac{a A \sin (c) \sin (d x)}{d}-\frac{a A \cos (c) \cos (d x)}{d}+\frac{a A \log \left (\sin \left (\frac{c}{2}+\frac{d x}{2}\right )\right )}{d}-\frac{a A \log \left (\cos \left (\frac{c}{2}+\frac{d x}{2}\right )\right )}{d}-2 a A x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.041, size = 50, normalized size = 1.5 \begin{align*} -2\,aAx-{\frac{Aa\cos \left ( dx+c \right ) }{d}}+{\frac{Aa\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}-2\,{\frac{Aac}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.994928, size = 55, normalized size = 1.67 \begin{align*} -\frac{2 \,{\left (d x + c\right )} A a + A a \cos \left (d x + c\right ) + A a \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.502994, size = 149, normalized size = 4.52 \begin{align*} -\frac{4 \, A a d x + 2 \, A a \cos \left (d x + c\right ) + A a \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) - A a \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 12.3135, size = 82, normalized size = 2.48 \begin{align*} - 2 A a x + A a \left (\begin{cases} - \frac{\cot{\left (c + d x \right )}}{d \csc{\left (c + d x \right )}} & \text{for}\: d \neq 0 \\\frac{x}{\csc{\left (c \right )}} & \text{otherwise} \end{cases}\right ) + A a \left (\begin{cases} \frac{x \cot{\left (c \right )} \csc{\left (c \right )}}{\cot{\left (c \right )} + \csc{\left (c \right )}} + \frac{x \csc ^{2}{\left (c \right )}}{\cot{\left (c \right )} + \csc{\left (c \right )}} & \text{for}\: d = 0 \\- \frac{\log{\left (\cot{\left (c + d x \right )} + \csc{\left (c + d x \right )} \right )}}{d} & \text{otherwise} \end{cases}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.37157, size = 66, normalized size = 2. \begin{align*} -\frac{2 \,{\left (d x + c\right )} A a - A a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + \frac{2 \, A a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]